﻿using Prism.Unity;

namespace FolderCompare;

public partial class App : PrismApplication
{
    public App()
    {
        ApplicationBase.SingletonInitialize();
    }

    protected override void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterSingleton<IAppSettings, AppSettings>();
        containerRegistry.RegisterSingleton<IDataHelper, DataHelper>();
    }

    protected override Window CreateShell()
    {
        var settings = Container.Resolve<IAppSettings>();
        var helper = Container.Resolve<IDataHelper>();
        settings.LoadConfig();
        DataHelper.InitializeDatabase(settings, helper);
        IocManage.Init(Container, settings);

        return Container.Resolve<MainWindow>();
    }
}